using System;
using NUnit.Framework;
using DotNetXmlSwfChart;

namespace DotNetXmlSwfChart.UnitTest
{
    [TestFixture]
    public class ChartValueFixture
    {
        [Test]
        public void ToSourceXml() {
            string testXml =
                "<chart_value prefix='$' " +
                             "suffix='%' " +
                             "decimals='1' " +
                             "decimal_char='.' " +
                             "separator=',' " +
                             "position='center' " +
                             "hide_zero='True' " +
                             "as_percentage='False' " +
                             "font='Arial' " +
                             "bold='True' " +
                             "size='10' " +
                             "color='ffffff' " +
                             "background_color='000000' " +
                             "alpha='1' " +
                             "/>";
            ChartValue cv = new ChartValue();
            cv.Prefix = "$";
            cv.Suffix = "%";
            cv.Decimals = 1;
            cv.DecimalChar = ".";
            cv.Separator = ",";
            cv.Position = "center";
            cv.HideZero = true;
            cv.AsPercentage = false;
            cv.Font = "Arial";
            cv.Bold = true;
            cv.Size = 10;
            cv.Color = "ffffff";
            cv.BackgroundColor = "000000";
            cv.Alpha = 1;
            Assert.AreEqual(testXml, cv.ToSourceXML());
        }
    }
}
